//
//  RHNetworkHelpCell.m
//  RuiHeAppApp
//
//  Created by Yan Chen on 2023/9/27.
//

#import "RHNetworkHelpCell.h"
@interface RHNetworkHelpCell()
@property (nonatomic, strong)QMUILabel *QTitleLab;

@property (nonatomic, strong)QMUILabel *ATitleLab;


@end
@implementation RHNetworkHelpCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        [self setupUI];
    }
    return self;
}

-(void)setupUI
{
    self.contentView.backgroundColor = CFTabViewBgColor;
    UIView *bgView = kView;
    bgView.backgroundColor = [UIColor whiteColor];
    bgView.layer.cornerRadius = 8;
    bgView.layer.masksToBounds = YES;
    [self.contentView addSubview:bgView];
    bgView.backgroundColor = [UIColor whiteColor];
    
    _QTitleLab = [[QMUILabel alloc]init];
    _QTitleLab.textColor = [UIColor whiteColor];
    _QTitleLab.text = @"Q";
    _QTitleLab.font = [UIFont systemFontOfSize:16];
    _QTitleLab.textAlignment = NSTextAlignmentCenter;
    _QTitleLab.backgroundColor = kCOLOR_HEX(@"56C271");
    _QTitleLab.layer.cornerRadius = 5;
    _QTitleLab.layer.masksToBounds = YES;
    [bgView addSubview:_QTitleLab];
    
    _QContentLab = [[QMUILabel alloc]init];
    _QContentLab.textColor = kCOLOR_HEX(@"3F4443");
    _QContentLab.font = [UIFont systemFontOfSize:16];
    _QContentLab.textAlignment = NSTextAlignmentLeft;
    _QContentLab.numberOfLines = 0;
    [bgView addSubview:_QContentLab];
    
    _ATitleLab = [[QMUILabel alloc]init];
    _ATitleLab.textColor = [UIColor whiteColor];
    _ATitleLab.text = @"A";
    _ATitleLab.font = [UIFont systemFontOfSize:16];
    _ATitleLab.textAlignment = NSTextAlignmentCenter;
    _ATitleLab.backgroundColor = kCOLOR_HEX(@"CECFD5");
    _ATitleLab.layer.cornerRadius = 5;
    _ATitleLab.layer.masksToBounds = YES;
    [bgView addSubview:_ATitleLab];
    
    _AContentLab = [[QMUILabel alloc]init];
    _AContentLab.textColor = [UIColor colorWithHexString:@"3F4443" alpha:0.6];
    _AContentLab.font = [UIFont systemFontOfSize:14];
    _AContentLab.textAlignment = NSTextAlignmentLeft;
    _AContentLab.qmui_lineHeight = 20;
    _AContentLab.numberOfLines = 0;
    [bgView addSubview:_AContentLab];
    
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsMake(10, 20, 10, 20));
    }];
    
    [self.QTitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.mas_offset(15);
        make.width.height.mas_offset(20);
    }];
    
    kWeakSelf;
    [self.QContentLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.QTitleLab.mas_right).offset(10);
        make.top.equalTo(weakSelf.QTitleLab);
        make.right.mas_offset(-15);
        make.height.greaterThanOrEqualTo(@20);
    }];
    
    [self.ATitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.QTitleLab);
        make.top.equalTo(weakSelf.QContentLab.mas_bottom).offset(20);
        make.width.height.equalTo(weakSelf.QTitleLab);
    }];

    [self.AContentLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.ATitleLab.mas_right).offset(10);
        make.top.equalTo(weakSelf.ATitleLab);
        make.right.mas_offset(-15);
        make.height.greaterThanOrEqualTo(@20);
        make.bottom.mas_offset(-15);
    }];
    
}


@end
